home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
art&graf.ix
/
art-3139
/
stadconv
/
read.me
< prev
next >
Wrap
Text File
|
1987-04-21
|
4KB
|
96 lines
Hello ppl,
Here is a small ass-routine to decode packed STAD-pictures to 32k-
(screenformat) pictures and to encode 32k-pictures to STAD-pics.
Some remarks to STAD:
STAD till version 1.2+ doesn't pack the pictures in the best way. Such
stored pictures will shrink (10-1000 Bytes) by encoding and later decoding
with my routine. The new files are absolutly compatible to the old ones
(the old Stad-Versions <=1.2+ could read them too!).
STAD 1.3+ doesn't make this "error" anymore, but sometimes there is an
error in the 2nd Byte of the compressed pictures (to see in the 2nd line
of the pictures to the left)
Since i don't use STAD, I will be glad to get some more hints/infos.
(adress is at the end of this doc)
Decode STAD-pictures:
=====================
The routine assumes, that the packed STAD-pic is already in memory. You
have to specify a destination-adress to write the uncompressed picture to
(32000 Bytes length) - e.g. the screen-adress. Both adresses are passed
via the stack to the routine. A return code is in the register D0. A zero
means "everything ok", a 1 means "this is not a packed STAD-picture".
The error 1 can in some very special (in fact only constructed) cases
occure on STAD-pictures: The compression-algorith used by STAD "compresses"
the picture in the worst case to a 32507 Bytes length picture. STAD
recognizes this of course and stores the 32k picture "as is" (not packed).
In such a case it is clearly that you cann't unpack the picture.....
The decode-algorith takes about 0.2 - 0.3 sec. to decode a STAD-picture.
Example (in GfA-Basic)
DIM buffer|(32000)
INLINE fromstad%,254
BLOAD "A:\TEST.PAC",V:buffer|(1)
IF C:fromstad%(L:V:buffer|(1),L:XBIOS(2))=1
PRINT "Fehler: kein gepacktes STAD-Format"
ENDIF
(Cursor on the "INLINE"-command, press HELP-Taste, select LOAD and load the
file "FROMSTAD.INL")
...it should also be possible to call the routine by other languages. The
routine returns by an RTS and leaves both 32-Bit-Values at the stack (a la
TRAP..). The routine needs following:
(sp) returnadress for RTS
4(sp) adress of the packed STAD-Bildes
8(sp) adress of the destination-buffer (Length 32000 Bytes)
(Odd adresses are allowed.)
Packing 32k-Pictures:
=====================
The routine assumes, that the original 32k-pic is already in memory (e.g.
in the screen-memory). The routine needs a buffer of 32507 Bytes (see the
section "decode" for details). If the packed picture is greater than 32000
Bytes then the original picture is copied to the buffer. The return value
in register D0 is the length of the compressed picture - if the length is
32000 then the picture is not compressed, but copied.
The pack-routine takes about 0.9 - 1.3 sec.
Example (in GfA-Basic)
DIM buffer|(32000)
INLINE tostad%,676
laenge%=C:tostad%(L:XBIOS(2),L:V:buffer|(1))
BSAVE "A:\TEST.PAC",L:V:buffer|(1),laenge%
(load inline, see above)
Other calls (see also explanation in the "decode"-section): Stack-Belegung:
(sp) returen adress for RTS
4(sp) adress of the unpacked 32k-pic
8(sp) buffer (destination) of the packed STAD-Pic.
(Length min.32507 Bytes)
By the way...
This package is public-domain. Everyone may (and should) it copy, use
and give it to friends. The distribution is only allowed as COMPLETE(!)
package (include ALL files - also both DOC-Versions).
If someone is corrects or changes anything on this programm I would be
glad if he/she drops me a note (and perhaps sends me the new version).
Wolfgang Ley e-mail to:
Teichstraße 9 or BWWL@DCZTU1.BITNET
W-3392 Clausthal-Zellerfeld BWWL@ibm.rz.tu-clausthal.de
(Germany)
Phone: Germany - 05323/82132